package demo;

import org.openjdk.jcstress.annotations.*;
import org.openjdk.jcstress.infra.results.II_Result;

/**
 * @program: jmm
 * @description:
 * @author: zhanghz001
 * @create: 2020-12-29 18:07
 **/
public class QuestionDemo {
    @JCStressTest
    @State
    @Outcome(id = "1, 0", expect = Expect.ACCEPTABLE, desc = "ACCEPTABLE")
    @Outcome(id = "0, 2", expect = Expect.ACCEPTABLE, desc = "ACCEPTABLE")
    @Outcome(id = "1, 2", expect = Expect.ACCEPTABLE, desc = "ACCEPTABLE")
    @Outcome(id = "0, 0", expect = Expect.ACCEPTABLE_INTERESTING, desc = "ACCEPTABLE_INTERESTING")
    
    public static class Case1 {
        int a;
        int b;
        
        @Actor
        public void actor1(II_Result r) {
            a = 1;
            r.r2 = b;
        }
        
        @Actor
        public void actor2(II_Result r) {
            b = 2;
            r.r1 = a;
        }
    }
    
}
